<template>
  <div class="home">
    <div class="box">
      {{billboard.content}}
    </div>
    <div class="columns">
  <div class="column">
    <!--侧边栏-->
    <CardBar></CardBar>
  </div>
  <div class="column is-three-quarters">
    <!--帖子列表-->
    <TopicList></TopicList>
  </div>
</div>
  </div>
</template>

<script>
import {getBillboard} from '@/api/billboard';
import CardBar from '@/views/card/CardBar'
import PostList from '@/views/post/index'

export default {
  name: 'HomeView',
  components: {CardBar , TopicList: PostList},
  data() {
    return {
      billboard: {
        content: ''
      }
    }
  },
  created() {
    this.fetchBillboard()
  },
  methods: {
    async fetchBillboard() {
      getBillboard().then((value) => {
        const { data } = value
        this.billboard = data
      }
      )
    }
  }
}
</script>
